<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<title>客户列表</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="/static/admins/css/bootstrap.css"/>
<link rel="stylesheet" href="/static/admins/css/amazeui.min.css">
</head>
<body>
<div class="container">

	<%@include file="header.jsp"%>
	
	<div class="text-right"><a class="btn btn-warning" href="/admin/toUserAdd">添加客户</a></div>
		
	<br>
	
	<table class="table table-bordered table-hover">

	<tr>
		<th width="5%">ID</th>
		<th width="5%">用户</th>
		<th width="10%">姓名</th>
		<th width="10%">电话</th>
		<th width="10%">地址</th>
		<th width="15%">操作</th>
	</tr>
	
	<c:forEach var="user" items="${userList}">
         <tr>
         	<td><p>${user.id}</p></td>
         	<td><p>${user.userName}</p></td>
         	<td><p>${user.name}</p></td>
         	<td><p>${user.phone}</p></td>
         	<td><p>${user.address}</p></td>
			<td>
				<a class="btn btn-info" href="/admin/toUserReset?id=${user.id}">重置密码</a>
				<a class="btn btn-primary" href="/admin/userEdit?id=${user.id}">修改</a>
				<a class="btn btn-danger" href="/admin/userDelete?id=${user.id}">删除</a>
			</td>
       	</tr>
     </c:forEach>
     
</table>
	<c:if test="${pageInfo.total!=0}">
		<div class="am-cf">
			共 ${pageInfo.total} 条记录
			<div class="am-fr">
				<ul class="am-pagination">
					<c:if test="${pageInfo.pageNum>1}">
						<li>
							<a href="/admin/userList?page=${pageInfo.pageNum - 1}">«</a>
						</li>
					</c:if>
					<c:if test="${pageInfo.pageNum == 1}">
						<li class="am-disabled">
							<a href="/admin/userList?page=${pageInfo.pageNum - 1}">«</a>
						</li>
					</c:if>
					<c:forEach begin="1" end="${pageInfo.pages}" step="1" var="i">
						<c:if test="${pageInfo.pageNum == i}">
							<li class="am-active">
								<a href="/admin/userList?page=${i}">${i}</a>
							</li>
						</c:if>
						<c:if test="${pageInfo.pageNum != i}">
							<li>
								<a href="/admin/userList?page=${i}">${i}</a>
							</li>
						</c:if>
					</c:forEach>
					<c:if test="${pageInfo.pageNum < pageInfo.pages}">
						<li>
							<a href="/admin/userList?page=${pageInfo.pageNum + 1}">»</a>
						</li>
					</c:if>
					<c:if test="${pageInfo.pageNum == pageInfo.pages}">
						<li class="am-disabled">
							<a href="/admin/userList?page=${pageInfo.pageNum + 1}">»</a>
						</li>
					</c:if>
				</ul>
			</div>
		</div>
	</c:if>

<br>${pageTool}<br>
</div>
</body>
</html>